<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"  />
	<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"  />
	<!-- bootstrap-table 表格插件样式 -->
	<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
	<link th:href="@{/css/animate.css}" rel="stylesheet"  />
	<link th:href="@{/css/style.css}" rel="stylesheet" />
	<link th:href="@{/ruoyi/css/ry-ui.css}" rel="stylesheet"  />
	<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg" >
	<form class="form-horizontal m-t"  id="signupForm">
		<input class="form-control" type="hidden"  name="taskId" th:value="*{taskId}"/>
		<input class="form-control" type="hidden"  id="processInstanceId" name="processInstanceId" th:value="*{processInstanceId}"/>
		<input class="form-control" type="hidden"  name="businessKey" th:value="${appFrom.customerNo}"/>
		<!--<input name="id" th:value="${appFrom.id}" type="hidden">-->
	    <br/>
		<h2 class="form-header h2" >客户准入审批信息</h2>
		<div class="row">
			<div class="col-xs-3 col-sm-4 col-md-offset-1">
				<label>客户编号：</label>
				<span th:text="${appFrom.customerNo}"/>
			</div>
			<div class="col-xs-3 col-sm-3">
				<label>客户名称：</label>
				<span th:text="${appFrom.customerName}"/>
			</div>
		</div>
		<div class="row">
			<div class="col-xs-10 col-sm-10 col-md-offset-1">
				<label>所属产业：</label>
				<span th:text="${@dict.getLabel('sys_industry_type',appFrom.customerIndustry)}"/>
			</div>
			<!--<div class="col-xs-3 col-sm-3">
				<label >创建时间：</label>
				<span th:text="${#dates.format(appFrom.createTime, 'yyyy-MM-dd')}"/>
			</div>-->
		</div>
		<div class="row">
			<div class="col-xs-3 col-sm-4 col-md-offset-1">
				<label >详细地址：</label>
				<span>[[${appFrom.customerProvinceName}]][[${appFrom.customerCityName}]][[${appFrom.customerAreaName}]][[${appFrom.customerAddress}]]</span>
			</div>
		</div>
		<div class="row">
			<div class="col-xs-10 col-sm-10 col-md-offset-1">
				<label>客户来源：</label>
				<span th:text="${appFrom.customerSource}"/>
			</div>
		</div>
		<div class="row">
			<div class="col-xs-10 col-sm-10 col-md-offset-1">
				<label>联系人：</label>
				<span th:text="${appFrom.customerLinkeUser}"/>
			</div>
		</div>
		<div class="row">
			<div class="col-xs-10 col-sm-10 col-md-offset-1">
				<label>联系邮件：</label>
				<span th:text="${appFrom.customerEmail}"/>
			</div>
		</div>

		<div class="row">
			<div class="col-xs-10 col-sm-10 col-md-offset-1">
				<label>联系电话：</label>
				<span th:text="${appFrom.customerPhone}"/>
			</div>
		</div>
    <br/>
		<th:block th:include="include :: approvalpage" />
	</form>
    <th:block th:include="include :: footer" />
	<th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        $(function () {
            var processInstanceId= $("#processInstanceId").val();
            var url ="/modeler/getProcessDiagram?processInstanceId="+processInstanceId;
            $(".imgcode").attr("src", url);
        });
        var files=new Array();
        $(".file-upload").each(function (i) {
            var val = $("input[name='" + this.id + "']").val();
            $(this).fileinput({
                'uploadUrl': '/common/upload',
                initialPreviewAsData: true,
                allowedFileExtensions: ['jpg', 'gif', 'png',".docx","doc","ppt","pptx","xls","xlsx","vsd","rtf","wps","pdf","txt"],//接收的文件后缀
                initialPreview: [val],
                maxFileCount: 1,
                autoReplace: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                files.push({"key": data.response.fileKey,"name": data.response.fileName, "url":data.response.url});
               // $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
            $(this).fileinput('_initFileActions');
        });

        <!--提交审核结果-->
        function submitCheckHandler() {
            if ($.validate.form()) {
                var data = $("#signupForm").serializeArray();
                for(var i=0;i<data.length;i++){
                    if(data[i].name=='comment'&&(data[i].value==''||data[i].value==null)){
                        $.modal.alertError("请填写审批意见");
                        return false;
					}
				}
				if(files!=null||files!=''){
                    for(var i=0;i<files.length;i++){
                        data.push({"name": "files["+i+"].key", "value":files[i].key});
                        data.push({"name": "files["+i+"].name", "value":files[i].name});
                        data.push({"name": "files["+i+"].url", "value":files[i].url});
                    }
				}
                console.log(data);
                $.operate.saveTab("/flow/finishTask", data);
            }
        }
    </script>
</body>
</html>